Skip to content

fix: deduplicate hardened image recommendations in DockerfileAnnotator (TC-4934)#263

Merged
a-oren merged 1 commit into
redhat-developer:mainfrom
a-oren:TC-4934
Jul 7, 2026
Merged

fix: deduplicate hardened image recommendations in DockerfileAnnotator (TC-4934)#263
a-oren merged 1 commit into
redhat-developer:mainfrom
a-oren:TC-4934

Conversation

@a-oren

@a-oren a-oren commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Deduplicate hardened image recommendations in DockerfileAnnotator.getHardenedRecommendations() by adding .distinct() to the stream pipeline, preventing duplicate entries when multiple providers return the same hardened image alternative
  • Add test for deduplication scenario with two providers recommending the same image

Test plan

  • Existing tests pass (DockerfileAnnotatorRecommendationTest, HardenedImageIntentionActionTest)
  • New testGetHardenedRecommendations_deduplicatesSameImage test verifies duplicates are removed
  • Manual verification: hover on FROM with hardened recommendations shows unique entries only

Implements TC-4934

…r (TC-4934)

Add .distinct() to getHardenedRecommendations() stream to prevent duplicate
entries when multiple providers return the same hardened image alternative.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@a-oren

a-oren commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Verification Report for TC-4934 (commit 3991875)

Check Result Details
Review Feedback N/A No review feedback on this PR
Root-Cause Investigation N/A No sub-tasks created
Scope Containment WARN 2 out-of-scope test files (justified — test coverage for the fix)
Diff Size PASS 449+/62- proportionate for deduplication fix + new test file
Commit Traceability PASS Commit 3991875 references TC-4934 in subject line
Sensitive Patterns PASS No secrets or credentials detected
CI Status PASS All 7 CI checks pass (SonarCloud, build-linux/macos/windows, verify)
Acceptance Criteria PASS 3 of 3 criteria met
Test Quality WARN Repetitive Test Detection: 4 generateMessage tests could be parameterized; Test Documentation: DockerfileAnnotatorRecommendationTest lacks Javadoc (pre-existing); Eval Quality: N/A
Test Change Classification ADDITIVE 17 new tests added, 0 removed; modified tests are signature adaptations only
Verification Commands N/A No verification commands specified

Overall: WARN

Scope Containment is WARN because 2 test files (DockerfileAnnotatorRecommendationTest.java, HardenedImageIntentionActionTest.java) are not listed in the task's Files to Modify/Create sections. This is expected — test files accompany the implementation. All task-specified files are present.

Test Quality notes (informational, does not affect overall):

  • Some generateMessage test methods in HardenedImageIntentionActionTest share identical structure and could be parameterized
  • DockerfileAnnotatorRecommendationTest test methods lack Javadoc comments (pre-existing gap, not introduced by this PR)

This comment was AI-generated by sdlc-workflow/verify-pr v0.12.2.

@a-oren
a-oren requested a review from ruromero July 6, 2026 15:26

@ruromero ruromero left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@a-oren
a-oren merged commit e954ce9 into redhat-developer:main Jul 7, 2026
7 checks passed
@a-oren
a-oren deleted the TC-4934 branch July 7, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants